<!DOCTYPE html>
<html>
<head>
{include file="public/meta"}
<title>找回密码 - {$maccms.site_name} </title>
<meta name="keywords" content="{$maccms.site_keywords}"/>
<meta name="description" content="{$maccms.site_description}"/>
{include file="public/include"}
</head>
<body>
{include file="public/head"}
<div id="conch-content" class="conch-content">
<div class="conch-ctwrap">
    <div class="container">
    <div class="hl-member">
    <div class="hl-reg-wrap">
       	<form method="post" id="fm" action="">
            <h2 class="hl-reg-title">密保找回密码</h2>
			<div class="hl-reg-group">
				<label>账号</label><input type="text" id="user_name" name="user_name" class="hl-reg-control" placeholder="请输入您的登录账号">
			</div>
			<div class="hl-reg-group">
				<label>密保问题</label><input type="text" id="user_question" name="user_question" class="hl-reg-control" placeholder="请输入您的密保问题">
			</div>
			<div class="hl-reg-group">
				<label>密保答案</label><input type="text" id="user_answer" name="user_answer" class="hl-reg-control" placeholder="请输入您的密保答案">
			</div>
			<div class="hl-reg-group">
				<label>新的密码</label><input type="password" id="user_pwd" name="user_pwd" class="hl-reg-control" placeholder="请输入您的新密码">
			</div>
			<div class="hl-reg-group">
				<label>确认密码</label><input type="password" id="user_pwd2" name="user_pwd2" class="hl-reg-control" placeholder="请输入您的确认密码">
			</div>
			<div class="hl-reg-group">
				<label>验证码</label><input type="text" class="hl-reg-control hl-reg-w2" id="verify" name="verify" placeholder="请输入验证码"><img class="hl-reg-w3" src="{:url('verify/index')}" onClick="this.src=this.src+'?'"  alt="单击刷新" />
			</div>
			<input type="button" id="btn_submit" class="hl-btn-submit hl-bg-conch" value="立即找回">
		</form>
        <div class="hl-reg-go hl-text-center clearfix">
            <a href="{:url('user/login')}">登录账号</a><a href="{:url('user/findpass_msg')}?ac=email">用邮箱找回</a><a href="{:url('user/findpass_msg')}?ac=phone">用手机找回</a>
        </div>
    </div>
    </div>
    </div>
</div>
</div>
{include file="public/foot"}
<script type="text/javascript">
	$(function(){
		$("body").bind('keyup',function(event) {
			if(event.keyCode==13){ $('#btnLogin').click(); }
		});
		$('#btn_submit').click(function() {
			if ($('#user_name').val()  == '') { alert('请输入用户！'); $("#user_name").focus(); return false; }
			if ($('#user_pwd').val()  == '') { alert('请输入密码！'); $("#user_pwd").focus(); return false; }
			if ($('#verify').val()  == '') { alert('请输入验证码！'); $("#verify").focus(); return false; }

			$.ajax({
				url: "{:url('user/findpass')}",
				type: "post",
				dataType: "json",
				data: $('#fm').serialize(),
				beforeSend: function () {
					$("#btn_submit").css("background","#fd6a6a").val("loading...");
				},
				success: function (r) {
					if(r.code==1){
						location.href="{:url('user/index')}";
					}
					else{
						alert(r.msg);
					}
				},
				complete: function () {
					$('#verify').click();
					$("#btn_submit").css("background","#fa4646").val("立即找回");
				}
			});

		});
	});
</script>
</body>
</html>